//
//  LookPhotoCollectionViewCell.m
//  XiangJi
//
//  Created by apple on 2017/8/23.
//  Copyright © 2017年 apple. All rights reserved.
//

#import "LookPhotoCollectionViewCell.h"

@implementation LookPhotoCollectionViewCell


- (instancetype)initWithFrame:(CGRect)frame{

    self = [super initWithFrame:frame];
    
    if (self) {
        
        self.cellImageView = [[UIImageView alloc] init];
        
        [self.contentView addSubview:self.cellImageView];
        
        self.bgView = [[UIView alloc] init];
        
        [self.contentView addSubview:self.bgView];
        
        self.cellBtn = [[UIButton alloc] init];
        
        [self.bgView addSubview:self.cellBtn];
    }
    
    return self;
}


- (void)layoutSubviews{

    [super layoutSubviews];
    
    self.cellImageView.clipsToBounds = YES;
    
    [self.cellImageView mas_makeConstraints:^(MASConstraintMaker *make) {
       
        make.top.left.bottom.right.equalTo(self.contentView);
    }];
    
    
    
    self.bgView.layer.cornerRadius = 9;
    
    self.bgView.backgroundColor = [UIColor whiteColor];
    
    [self.bgView mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.right.mas_equalTo(self.cellImageView.mas_right).offset(8);
        make.top.mas_equalTo(self.cellImageView.mas_top).offset(-8);
        make.width.offset(20*Scale_Ratio);
        make.height.offset(20*Scale_Ratio);
    }];
    
    
    self.cellBtn.contentHorizontalAlignment = NSTextAlignmentCenter;
    
    [self.cellBtn mas_makeConstraints:^(MASConstraintMaker *make) {
       
        make.right.mas_equalTo(self.bgView.mas_right).offset(0);
        make.top.mas_equalTo(self.bgView.mas_top).offset(0);
        make.width.offset(16*Scale_Ratio);
        make.height.offset(16*Scale_Ratio);
    }];
    
}



@end
